<template>
	<view class="common-1">
		<u-navbar :title="pageInfos.title+'详情'" @leftClick="leftClick" :autoback="true"></u-navbar>
		<patenddes :type="pageInfos.type"></patenddes>
		<material v-if="['answer','apply'].includes(pageInfos.type)" :type="pageInfos.type"></material>
		<process v-if="['answer','supervise'].includes(pageInfos.type)" :type="pageInfos.type"></process>
		<serve v-if="pageInfos.type != 'supervise'" :type="pageInfos.type"></serve>
		<advantage :type="pageInfos.type"></advantage>
		<client></client>
		<view class="flex-col items-center button"><text class="text_8" @click="sureAdd">立即联系</text></view>
	</view>
</template>

<script>
import advantage from '../../components/home/advantage.vue';
import client from '../../components/home/client.vue';
import serve from '../../components/home/serve.vue';
import process from '../../components/home/process.vue';
import material from '../../components/home/material.vue';
import patenddes from '../../components/home/patenddes.vue';
export default {
	components:{advantage,serve,client,process,material,patenddes},
	data() {
		return {
			pageInfos:{}
		};
	},
	onLoad(option) {
		if(option.info) {
			this.pageInfos = JSON.parse(option.info)
		}
	},
	methods:{
		leftClick(){
			if (getCurrentPages().length > 1) {
				uni.navigateBack();
			} else {
				uni.switchTab({
					url: '../../pages/index/index'
				})
			}
		},
		sureAdd(){
			uni.makePhoneCall({
				phoneNumber: '15755387045' //仅为示例
			});
		}
	}
}
</script>

<style lang="scss">
.common-1 {
	background: #f6f4f8;
}
.button {
	position: fixed;
	width: 100%;
	bottom: 0;
	padding: 26rpx 0 28rpx;
	background-color: #37c637;
	box-shadow: 0px -5rpx 7rpx #00000026;
	.text_8 {
	  color: #ffffff;
	  font-size: 34rpx;
	  font-family: Microsoft YaHei;
	  line-height: 34rpx;
	}
  }
</style>
